import store from "@/store";

export default {
  inserted(el, binding) {
    const { value } = binding;
    const hasPermission = store.getters["permissions/hasPermission"](value);

    if (!hasPermission) {
      el.parentNode && el.parentNode.removeChild(el); // 如果没有权限，移除元素
    }
  },
};
